package com.gk.panda.apis.enums;

/**
 * @description: 事件类型枚举
 * @date: 2022/10/25 17:48
 **/
public enum DeviceManagerModelTypeEnum {

    INFRARED_CAMERA("infrared_camera","红外相机"),
    VIDEO_CAMERA("video_camera","摄像机"),
    ECOLOGICAL_EQUIPMENT("ecological_equipment","生态设备"),
    ;


    private final String code;
    private final String desc;


    DeviceManagerModelTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据code获取值
     * @param code
     * @return
     */
    public static String getDescByCode(String code) {
        DeviceManagerModelTypeEnum[] values = DeviceManagerModelTypeEnum.values();
        for (DeviceManagerModelTypeEnum tmp : values){
            if (tmp.getCode().equals(code)){
                return tmp.getDesc();
            }
        }
        return null;
    }
}
